<template>
  <label v-show="support" ref="btn" class="simple-uploader-btn">
    <slot />
  </label>
</template>

<script>
import { uploaderMixin, supportMixin } from '../common/mixins'
const COMPONENT_NAME = 'uploader-btn'
export default {
  name: COMPONENT_NAME,
  mixins: [uploaderMixin, supportMixin],
  props: {
    directory: {
      type: Boolean,
      default: false
    },
    single: {
      type: Boolean,
      default: false
    },
    attrs: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, this.attrs)
    })
  }
}
</script>

